<?php

/**
 * BKloud Framework
 * Core_Application class
 * 
 * LICENSE:
 * BKloud Framework duoc xay dung va phat trien boi nhom BKloud - dai hoc bach khoa Ha Noi 
 * Ban duoc phep su dung framework nay cho muc dich hoc tap , nghien cuu va cac ung dung phi thuong mai
 * 
 * @copyright Copyright (c) 2011 BKloud - HPCC.
 * @version 0.1
 */

class Core_Application
{
    /**
     * Constructor
     *
     * Khoi tao Application.Tao ra mot doi tuong duy nhat $registry cua Core_Registry.
     * Luu tru mang config, doi tuong cua Core_Http,Core_Template vao $registry 
     * @param  array  $config
     * @return void
     */
    public function __construct($config)
    {

        $registry             = Core_Registry::singleton();

        $registry['config']   = $config;

        $http                 = new Core_Http();
        $registry['http']     = $http;

        $template             = new Core_Template();
        $registry['template'] = $template;
    }


    /**
     * Router mot doi tuong cua Core_Router
     *
     * @return void
     */
    public function run()
    {
        $objRouter = new Core_Router();
        $objRouter->router();
    }
}
